package org.andes.kownledge;

import java.util.ArrayList;
import java.util.List;

import lisp.SExp;

import org.armedbear.lisp.LispObject;


/**
 * Created by IntelliJ IDEA.
 * User: wenfeix
 * Date: 2011-2-1
 * Time: 21:30:07
 * To change this template use File | Settings | File Templates.
 */
public class Ontology {


	public static List<EntryProp> Ontology_EntryProp_Types=new ArrayList<EntryProp>();
   
    
    
    
//(defmacro def-entryprop (Type form
//			 &key (fields nil)
//			      (helpform form)
//			      (doc nil) (English Nil))
// "Define an Entry proposition type and store the value."
// (let ((E (make-entryProp 
//	    :type Type
//	    :kbform form
//	    :helpform helpform
//	    :fields (fill-field-defs 
//		     fields form helpform)
//	    :Doc Doc
//	    :English English)))
//   (postpend *Ontology-EntryProp-Types* E)
//   E))
// 
    
    
// (def-entryprop vector (vector ?body ?quantity ?direction)
//    :helpform (vector ?quantity ?direction)
//    :Doc "The generic vector entry tool."
//    :English ("a ~a" (ont-vector-entryprop-format-func ?body ?quantity ?direction)))
//    
    
    
    public static void defEntryprop(){
    	
    }
    
    /**
     * (defun help-entryprop-p (Prop)
  "Is the specified prop a valid helpsys form entry proposition."
  (loop for P in *Ontology-EntryProp-types*
      when (unify (EntryProp-helpform P) Prop)
      return P))
     */
    public static boolean help_entryprop_p(SExp entry){
        //return false;
        for (EntryProp entryProp : Ontology_EntryProp_Types) {
        	if(entryProp.getHelpForm().unify(entry))
        		return true;
		}
        return false;
    }
    
//    ; For readability when used as a predicate:
//    	(defun quantity-expression-p (exp)
//    	 "Non-null if given form is a declared quantity expression"
//    	  (lookup-expression-struct exp))
    public static boolean quantity_expression_p(LispObject sought){
    	return true;
    	
    }
}
